package com.lzy.springcloud.service;

import com.lzy.springcloud.entity.CommonResult;
import com.lzy.springcloud.entity.Payment;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

//@Service
@Component //@Service和@Component效果一样
@FeignClient(value = "CLOUD-PAYMENT-SERVICE")
public interface PaymentFeignService {
    //要注意8001提供方的controller上的@RequestMapping("/api")
    @GetMapping(value = "/api/payment/get/{id}")
    CommonResult<Payment> getPaymentById(@PathVariable("id") Long id);
    @GetMapping("/api/payment/discovery")
    Object discovery();

    @GetMapping("/api/payment/timeout")
    String timeout();
}
